package com.renshuai.demo.mybatis.config;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.stereotype.Component;
@Component
public class MyBeanPostProcessor implements BeanPostProcessor {
	
	

	public MyBeanPostProcessor() {
		super();
		System.out.println("MyBeanPostProcessor");
	}

	public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
		if (beanName.equals("order")) {
			System.out.println("postProcessBeforeInitialization");
		}
		return bean;
	}

	public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
		if (beanName.equals("order")) {
			System.out.println("postProcessAfterInitialization");
		}
		return bean;
	}

}
